<%@page contentType="text/html;charset=utf-8"%>
<%@ taglib prefix="cw" uri="/widget-tags"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
	<head>
		<title>界面标签原型</title>
		<cw:base />
		<script type="text/javascript">
			var json =
				[
				{"text" : "表格+分栏", "id" : 200, "leaf" : false, "cls" : "folder", "children" : [
				{"text" : "个人信息登记", "id" : 201, "title" : "个人信息登记", "rel" : "sample/combination/form_fieldset/inforegister.jsp", "name": "sample/combination/form_fieldset/src/inforegister.htm","leaf" : true, "cls" : "file"}
				]
				},
				{"text" : "联想式表单查询", "id" : 100, "leaf" : false, "cls" : "folder", "children" : [
				{"text" : "个人信息修改", "id" : 101, "title" : "个人信息修改", "rel" : "sample/combination/searchform/formLoad.jsp", "name": "sample/combination/searchform/src/formLoad.htm", "leaf" : true, "cls" : "file"}
				]
				},
				{"text" : "表单+表格", "id" : 300, "leaf" : false, "cls" : "folder", "children" : [
				{"text" : "个人信息查询", "id" : 301, "title" : "个人信息查询", "rel" : "sample/combination/form_grid/personInfo.jsp", "name": "sample/combination/form_grid/src/personInfo.htm", "leaf" : true, "cls" : "file"},
				{"text" : "门诊特殊病例登记", "id" : 302, "title" : "门诊特殊病例登记", "rel" : "sample/combination/form_grid/formgrid.jsp", "name": "sample/combination/form_grid/src/formgrid.htm", "leaf" : true, "cls" : "file"}
				]
				},
				{"text" : "树+表单", "id" : 410, "leaf" : false, "cls" : "folder", "children" : [
				{"text" : "功能树维护", "id" : 411, "title" : "功能树维护", "rel" : "sample/combination/tree_form/treeForm.jsp", "name": "sample/combination/tree_form/src/treeForm.htm", "leaf" : true, "cls" : "file"}
				]
				},
				{"text" : "标签式表单查看", "id" : 510, "leaf" : false, "cls" : "folder", "children" : [
				{"text" : "标签式查看", "id" : 511, "title" : "标签式查看", "rel" : "sample/combination/form_tabs/formLoad.jsp", "name": "sample/combination/form_tabs/src/formLoad.htm", "leaf" : true, "cls" : "file"}
				]
				}
				];
				
			var json1 =
				[
				{"text" : "工具栏", "id" : 800, "leaf" : false, "cls" : "folder", "children" : [
				{"text" : "工具栏", "id" : 801, "title" : "工具栏", "rel" : "sample/component/bar/toolbar.jsp", "name": "sample/component/bar/src/toolbar.htm", "leaf" : true, "cls" : "file"},
				{"text" : "状态栏", "id" : 802, "title" : "状态栏", "rel" : "sample/component/bar/statusbar.jsp", "name": "sample/component/bar/src/statusbar.htm", "leaf" : true, "cls" : "file"}]
				},
				{"text" : "按钮", "id" : 200, "leaf" : false, "cls" : "folder", "children" : [
				{"text" : "普通按钮", "id" : 201, "title" : "普通按钮", "rel" : "sample/component/button/button.jsp", "name": "sample/component/button/src/button.htm", "leaf" : true, "cls" : "file"},
				{"text" : "图标按钮", "id" : 204, "title" : "图标按钮", "rel" : "sample/component/button/iconButton.jsp", "name": "sample/component/button/src/iconButton.htm", "leaf" : true, "cls" : "file"},
				{"text" : "表单按钮", "id" : 202, "title" : "表单按钮", "rel" : "sample/component/button/formButton.jsp", "name": "sample/component/button/src/formButton.htm", "leaf" : true, "cls" : "file"},
				{"text" : "菜单按钮", "id" : 203, "title" : "菜单按钮", "rel" : "sample/component/button/menuButton.jsp", "name": "sample/component/button/src/menuButton.htm", "leaf" : true, "cls" : "file"}]
				},
				{"text" : "图表", "id" : 900, "leaf" : false, "cls" : "folder", "children" : [
				{"text" : "图表", "id" : 901, "title" : "图表", "rel" : "sample/component/chart/fusionchart.jsp", "name": "sample/component/chart/src/chart.htm", "leaf" : true, "cls" : "file"},
				{"text" : "饼状图表", "id" : 902, "title" : "饼状图表", "rel" : "sample/component/chart/pie.jsp", "name": "sample/component/chart/src/chart.htm", "leaf" : true, "cls" : "file"},
				{"text" : "折线图表", "id" : 903, "title" : "折线图表", "rel" : "sample/component/chart/line.jsp", "name": "sample/component/chart/src/chart.htm", "leaf" : true, "cls" : "file"},
				{"text" : "面积图表", "id" : 904, "title" : "面积图表", "rel" : "sample/component/chart/area.jsp", "name": "sample/component/chart/src/chart.htm", "leaf" : true, "cls" : "file"},
				{"text" : "环形图表", "id" : 905, "title" : "环形图表", "rel" : "sample/component/chart/ring.jsp", "name": "sample/component/chart/src/chart.htm", "leaf" : true, "cls" : "file"}]
				},
				{"text" : "表单", "id" : 100, "leaf" : false, "cls" : "folder", "children" : [
				{"text" : "选择框", "id" : 101, "leaf" : false, "cls" : "folder", "children" : [
				{"text" : "复选框", "id" : 111, "title" : "复选框", "rel" : "sample/component/form/checkbox(radio)/checkbox.jsp", "name": "sample/component/form/checkbox(radio)/src/checkbox.htm", "leaf" : true, "cls" : "file"},
				{"text" : "单选框", "id" : 121, "title" : "单选框", "rel" : "sample/component/form/checkbox(radio)/radio.jsp", "name": "sample/component/form/checkbox(radio)/src/radio.htm", "leaf" : true, "cls" : "file"}]
				},
				{"text" : "下拉框", "id" : 102, "leaf" : false, "cls" : "folder", "children" : [
				{"text" : "普通下拉框", "id" : 112, "title" : "普通下拉框", "rel" : "sample/component/form/combobox/combobox.jsp", "name": "sample/component/form/combobox/src/combobox.htm", "leaf" : true, "cls" : "file"},
				{"text" : "下拉表格", "id" : 122, "title" : "下拉表格", "rel" : "sample/component/form/combobox/gridSelect.jsp", "name": "sample/component/form/combobox/src/gridSelect.htm", "leaf" : true, "cls" : "file"},
				{"text" : "二级联动", "id" : 132, "title" : "二级联动", "rel" : "sample/component/form/combobox/linkageWith2Level.jsp", "name": "sample/component/form/combobox/src/linkageWith2Level.htm", "leaf" : true, "cls" : "file"},
				{"text" : "三级联动", "id" : 142, "title" : "三级联动", "rel" : "sample/component/form/combobox/linkageWith3Level.jsp", "name": "sample/component/form/combobox/src/linkageWith3Level.htm", "leaf" : true, "cls" : "file"},
				{"text" : "树下拉框", "id" : 152, "title" : "树下拉框", "rel" : "sample/component/form/combobox/treeSelect.jsp", "name": "sample/component/form/combobox/src/treeSelect.htm","leaf" : true, "cls" : "file"}]
				},
				{"text" : "日期", "id" : 103, "leaf" : false, "cls" : "folder", "children" : [
				{"text" : "普通日期", "id" : 113, "title" : "普通日期", "rel" : "sample/component/form/date/date.jsp", "name": "sample/component/form/date/src/date.htm", "leaf" : true, "cls" : "file"},
				{"text" : "年月", "id" : 123, "title" : "年月", "rel" : "sample/component/form/date/month.jsp", "name": "sample/component/form/date/src/month.htm", "leaf" : true, "cls" : "file"},
				{"text" : "时间", "id" : 133, "title" : "时间", "rel" : "sample/component/form/date/time.jsp", "name": "sample/component/form/date/src/time.htm", "leaf" : true, "cls" : "file"},
				{"text" : "日期+时间", "id" : 143, "title" : "日期+时间", "rel" : "sample/component/form/date/datetime.jsp", "name": "sample/component/form/date/src/datetime.htm", "leaf" : true, "cls" : "file"}]
				},
				{"text" : "文件上传", "id" : 104, "leaf" : false, "cls" : "folder", "children" : [
				{"text" : "文件上传", "id" : 114, "title" : "文件上传", "rel" : "sample/component/form/fileupload/upload.jsp", "name": "sample/component/form/fileupload/src/upload.htm", "leaf" : true, "cls" : "file"}]
				},
				{"text" : "文档编辑", "id" : 105, "leaf" : false, "cls" : "folder", "children" : [
				{"text" : "文档编辑", "id" : 115, "title" : "文档编辑", "rel" : "sample/component/form/htmlEditor/htmlEditor.jsp", "name": "sample/component/form/htmlEditor/src/htmlEditor.htm", "leaf" : true, "cls" : "file"}]
				},
				{"text" : "列表框", "id" : 106, "leaf" : false, "cls" : "folder", "children" : [
				{"text" : "列表框", "id" : 116, "title" : "列表框", "rel" : "sample/component/form/listbox/listbox.jsp", "name": "sample/component/form/listbox/src/listbox.htm", "leaf" : true, "cls" : "file"}]
				},
				{"text" : "基本输入框", "id" : 107, "leaf" : false, "cls" : "folder", "children" : [
				{"text" : "数字输入框", "id" : 117, "title" : "数字输入框", "rel" : "sample/component/form/text/numberField.jsp", "name": "sample/component/form/text/src/numberField.htm", "leaf" : true, "cls" : "file"},
				{"text" : "大文本输入框", "id" : 127, "title" : "大文本输入框", "rel" : "sample/component/form/text/textArea.jsp", "name": "sample/component/form/text/src/textArea.htm", "leaf" : true, "cls" : "file"},
				{"text" : "文本输入框", "id" : 137, "title" : "文本输入框", "rel" : "sample/component/form/text/textField.jsp", "name": "sample/component/form/text/src/textField.htm", "leaf" : true, "cls" : "file"}]
				},
				{"text" : "表单交互", "id" : 108, "leaf" : false, "cls" : "folder", "children" : [
				{"text" : "交互成功", "id" : 118, "title" : "交互成功", "rel" : "sample/component/form/form/form.jsp", "name": "sample/component/form/form/src/form.htm", "leaf" : true, "cls" : "file"},
				{"text" : "交互失败", "id" : 128, "title" : "交互失败", "rel" : "sample/component/form/form/formfail.jsp", "name": "sample/component/form/form/src/formfail.htm", "leaf" : true, "cls" : "file"}]
				},
				{"text" : "表单验证", "id" : 109, "leaf" : false, "cls" : "folder", "children" : [
				{"text" : "类型验证", "id" : 119, "title" : "类型验证", "rel" : "sample/component/form/validate/type.jsp", "name": "sample/component/form/validate/src/type.htm", "leaf" : true, "cls" : "file"},
				{"text" : "一般验证", "id" : 129, "title" : "一般验证", "rel" : "sample/component/form/validate/common.jsp", "name": "sample/component/form/validate/src/common.htm", "leaf" : true, "cls" : "file"},
				{"text" : "自定义验证", "id" : 139, "title" : "自定义验证", "rel" : "sample/component/form/validate/custom.jsp", "name": "sample/component/form/validate/src/custom.htm", "leaf" : true, "cls" : "file"}]
				}]
				},
				
				{"text" : "表格", "id" : 300, "leaf" : false, "cls" : "folder", "children" : [
				{"text" : "基本表格", "id" : 301, "leaf" : false, "cls" : "folder", "children" : [
				{"text" : "分页", "id" : 311, "title" : "分页", "rel" : "sample/component/grid/baseGrid/gridPage.jsp", "name": "sample/component/grid/baseGrid/src/gridPage.htm", "leaf" : true, "cls" : "file"},
				{"text" : "样式", "id" : 321, "title" : "样式", "rel" : "sample/component/grid/baseGrid/gridStyle.jsp", "name": "sample/component/grid/baseGrid/src/gridStyle.htm", "leaf" : true, "cls" : "file"},
				{"text" : "列渲染", "id" : 351, "title" : "列渲染", "rel" : "sample/component/grid/baseGrid/gridRender.jsp", "name": "sample/component/grid/baseGrid/src/gridRender.htm", "leaf" : true, "cls" : "file"},
				{"text" : "工具栏", "id" : 361, "title" : "工具栏", "rel" : "sample/component/grid/baseGrid/gridToolbar.jsp", "name": "sample/component/grid/baseGrid/src/gridToolbar.htm", "leaf" : true, "cls" : "file"},
		        {"text" : "异常处理", "id" : 331, "title" : "异常处理", "rel" : "sample/component/grid/baseGrid/gridError.jsp", "name": "sample/component/grid/baseGrid/src/gridError.htm", "leaf" : true, "cls" : "file"},
				{"text" : "加载验证", "id" : 341, "title" : "加载验证", "rel" : "sample/component/grid/baseGrid/gridValidate.jsp", "name": "sample/component/grid/baseGrid/src/gridValidate.htm", "leaf" : true, "cls" : "file"}]
				},
				{"text" : "统计表格", "id" : 307, "leaf" : false, "cls" : "folder", "children" : [
				{"text" : "前台统计", "id" : 317, "title" : "前台统计", "rel" : "sample/component/grid/gridSummary/localSummary.jsp", "name": "sample/component/grid/gridSummary/src/localSummary.htm", "leaf" : true, "cls" : "file"},
				{"text" : "后台统计", "id" : 327, "title" : "后台统计", "rel" : "sample/component/grid/gridSummary/remoteSummary.jsp", "name": "sample/component/grid/gridSummary/src/remoteSummary.htm", "leaf" : true, "cls" : "file"},
				{"text" : "选择行统计", "id" : 337, "title" : "选择行统计", "rel" : "sample/component/grid/gridSummary/selectSummary.jsp", "name": "sample/component/grid/gridSummary/src/selectSummary.htm", "leaf" : true, "cls" : "file"}]
				},
				{"text" : "导出表格", "id" : 308, "leaf" : false, "cls" : "folder", "children" : [
				{"text" : "不分页导出", "id" : 318, "title" : "不分页导出", "rel" : "sample/component/grid/gridExport/nopageExport.jsp", "name": "sample/component/grid/gridExport/src/nopageExport.htm", "leaf" : true, "cls" : "file"},
				{"text" : "分页前台导出", "id" : 328, "title" : "分页前台导出", "rel" : "sample/component/grid/gridExport/pageLocalExport.jsp", "name": "sample/component/grid/gridExport/src/pageLocalExport.htm", "leaf" : true, "cls" : "file"},
				{"text" : "分页后台导出", "id" : 338, "title" : "分页后台导出", "rel" : "sample/component/grid/gridExport/pageRemoteExport.jsp", "name": "sample/component/grid/gridExport/src/pageRemoteExport.htm", "leaf" : true, "cls" : "file"},
				{"text" : "分页图片导出", "id" : 348, "title" : "分页图片导出", "rel" : "sample/component/grid/gridExport/pageImageExport.jsp", "name": "sample/component/grid/gridExport/src/pageImageExport.htm", "leaf" : true, "cls" : "file"}]
				},
				{"text" : "可编辑表格", "id" : 302, "leaf" : false, "cls" : "folder", "children" : [
				{"text" : "可编辑表格", "id" : 312, "title" : "可编辑表格", "rel" : "sample/component/grid/editGrid/editGrid.jsp", "name": "sample/component/grid/editGrid/src/editGrid.htm", "leaf" : true, "cls" : "file"}]
				},
				{"text" : "动态表格", "id" : 306, "leaf" : false, "cls" : "folder", "children" : [
				{"text" : "动态表格", "id" : 316, "title" : "动态表格", "rel" : "sample/component/grid/dynamicGrid/dynamicGrid.jsp", "name": "sample/component/grid/dynamicGrid/src/dynamicGrid.htm", "leaf" : true, "cls" : "file"}]
				},
				{"text" : "分组表格", "id" : 303, "leaf" : false, "cls" : "folder", "children" : [
				{"text" : "分组表格", "id" : 313, "title" : "分组表格", "rel" : "sample/component/grid/groupGrid/groupGrid.jsp", "name": "sample/component/grid/groupGrid/src/groupGrid.htm", "leaf" : true, "cls" : "file"}]
				},
				{"text" : "属性表格", "id" : 304, "leaf" : false, "cls" : "folder", "children" : [
				{"text" : "属性表格", "id" : 314, "title" : "属性表格", "rel" : "sample/component/grid/propertyGrid/propertyGrid.jsp", "name": "sample/component/grid/propertyGrid/src/propertyGrid.htm", "leaf" : true, "cls" : "file"}]
				},
				{"text" : "树形表格", "id" : 305, "leaf" : false, "cls" : "folder", "children" : [
				{"text" : "树形表格", "id" : 315, "title" : "树形表格", "rel" : "sample/component/grid/treeGrid/treeGrid.jsp", "name": "sample/component/grid/treeGrid/src/treeGrid.htm", "leaf" : true, "cls" : "file"}]
				}]
				},
				{"text" : "布局", "id" : 400, "leaf" : false, "cls" : "folder", "children" : [
				{"text" : "区域布局", "id" : 402, "title" : "区域布局", "rel" : "sample/component/layout/regionLayout.jsp", "name": "sample/component/layout/src/regionLayout.htm", "leaf" : true, "cls" : "file"},
				{"text" : "分组布局", "id" : 405, "title" : "分组布局", "rel" : "sample/component/layout/fieldSetLayout.jsp", "name": "sample/component/layout/src/fieldSetLayout.htm", "leaf" : true, "cls" : "file"},
				{"text" : "标签式布局", "id" : 403, "title" : "标签式布局", "rel" : "sample/component/layout/tabLayout.jsp", "name": "sample/component/layout/src/tabLayout.htm","leaf" : true, "cls" : "file"},
				{"text" : "Outlook布局", "id" : 404, "title" : "outlook布局", "rel" : "sample/component/layout/outlookLayout.jsp", "name": "sample/component/layout/src/outlookLayout.htm","leaf" : true, "cls" : "file"}]
				},
				{"text" : "树", "id" : 700, "leaf" : false, "cls" : "folder", "children" : [
				{"text" : "普通树", "id" : 701, "title" : "普通树", "rel" : "sample/component/tree/baseTree.jsp", "name": "sample/component/tree/src/baseTree.htm","leaf" : true, "cls" : "file"},
				{"text" : "可编辑树", "id" : 702, "title" : "可编辑树", "rel" : "sample/component/tree/editTree.jsp", "name": "sample/component/tree/src/editTree.htm","leaf" : true, "cls" : "file"}]
				},
				{"text" : "弹出框", "id" : 1000, "leaf" : false, "cls" : "folder", "children" : [
				{"text" : "弹出框", "id" : 1001, "title" : "弹出框", "rel" : "sample/component/window/window.jsp", "name": "sample/component/window/src/window.htm", "leaf" : true, "cls" : "file"},
				{"text" : "提示框", "id" : 1002, "title" : "提示框", "rel" : "sample/component/window/message.jsp", "name": "sample/component/window/src/message.htm", "leaf" : true, "cls" : "file"}]
				},
				{"text" : "开发常用标签控件", "id" : 2000, "leaf" : false, "cls" : "folder", "children" : [
				{"text" : "表单元素", "id" : 2001, "title" : "表单元素", "rel" : "sample/component/demoform/formElements.jsp", "name": "sample/component/demoform/src/formElements.htm", "leaf" : true, "cls" : "file"},
				{"text" : "表格控件", "id" : 2002, "title" : "表格控件", "rel" : "sample/component/demogrid/gridElements.jsp", "name": "sample/component/demogrid/src/gridElements.htm", "leaf" : true, "cls" : "file"},
				{"text" : "树控件", "id" : 2003, "title" : "树控件", "rel" : "sample/component/demotree/treeElements.jsp", "name": "sample/component/demotree/src/treeElements.htm", "leaf" : true, "cls" : "file"}]
		   		}
				];
		
			var json2 =
				[
				{"text" : "广州社保", "id" : 1100, "leaf" : false, "cls" : "folder", "children" : [
		   			{"text" : "企业离退休待遇核定", "id" : 1101, "title" : "企业离退休待遇核定", "rel" : "pages/example/f30120201/f30120201.jsp", "name": "sample/application/yzsb/src/index.htm", "leaf" : true, "cls" : "file"}
		   			]
		   		}
		   		];
				
			function treeBeforeLoad(treeLoader, node){
				alert(node.id);
			}
		        
			function treeClick(node,e){
				alert(node.id);
			}
		        
			function nodeclick(node,e){
				if(node.attributes.leaf)
				addTab(node.attributes.id,node.attributes.title,node.attributes.rel,node.attributes.name);
			}
		             
			function addTab(id,title, href, src) {
				var tab1 = Ext.getCmp('tab1');
				var panels = tab1.items;
				tab1.add( {
						id :id,
						title :title,
						iconCls :'tabs',
						closable :true,
						height :600,
						html :'<Iframe id="abc" name="abc" width="100%" height="100%" scrolling="auto" frameborder="0" src="tabFrame.jsp?sampleurl='
								+ href
								+ '&codeurl='
								+ src
								+ '" style="clear:both;margin-left:0px;margin-right:0px;float:right;"></Iframe>'
					});
				tab1.activate(id);
			}
			
			/* 反向设置所有已打开页面的皮肤 */
			function reverseChangeSkin(skinName){
				var panels = Ext.getCmp("tab1").items;
				for(var i=1;i<panels.length;i++){
					document.getElementById(panels.get(i).id).childNodes[0].childNodes[0].childNodes[0].contentWindow.reverseChangeSkin(skinName);
				}
			}
		</script>
	</head>
	<body>
		<div id="main" style="width: 100%; height: 100%;">
			<cw:tab id="tab1" activeTab="0" tabScroll="true">
				<cw:panel title="欢迎" autoHeight="true" autoLoad="{url:'background.jsp',scripts: true}" />
			</cw:tab>
		</div>
		<div id="tree">
			<cw:tree id="tree" data="json" allowEdit="false" rootVisible="false" onBeforeLoad="treeBeforeLoad" 
			onClick="nodeclick" />
		</div>
	
		<div id="tree1">
			<cw:tree id="tree1" data="json1" allowEdit="false" rootVisible="false" onBeforeLoad="treeBeforeLoad"
				onClick="nodeclick" />
		</div>
	
	    <div id="tree2">
			<cw:tree id="tree2" data="json2" allowEdit="false" rootVisible="false" onBeforeLoad="treeBeforeLoad"
				onClick="nodeclick" />
		</div>
	
		<cw:composite id="compositeLayout" layout="region" height="600" title="" autoWidth="true">
			<cw:panel region="west" title="" width="150" header="false" autoScroll="true">
				<cw:composite id="innerComposite" layout="sequence" autoHeight="true" title="" autoWidth="true">
					<cw:panel id="i2" title="控件分类示例" autoHeight="true" collapsible="true"  contentId="tree1" autoScroll="true"/>
					<cw:panel id="i1" title="组合应用示例" autoHeight="true" collapsible="true" contentId="tree" autoScroll="true" />
	                <cw:panel id="i3" title="应用示例" autoHeight="true" collapsible="true" contentId="tree2" autoScroll="true" />
				</cw:composite>
			</cw:panel>
			<cw:panel region="center" title="内容区域" header="false" contentId="main" />
		</cw:composite>
	</body>
</html>
